<?php

namespace App\Http\Controllers\Managea;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Repositories\PreferlogRepository;
use App\Traits\BaseFun;
use DB;

class PreferlogController extends Controller
{
	public function __construct(PreferlogRepository $PreferlogRepository)
    {
        $this->PreferlogRepository=$PreferlogRepository;
    }
    public function Preferlog(Request $request,$id)
    {   
        $res = $this->PreferlogRepository->pageList(['preferid'=>$id]);
        if ($res) {
           $ArrDate = ['state' => 0, 'data' => $res, 'token' => $request->input('token')];
        }else{
           $ArrDate = ['state' => 2, 'data' => $res, 'msg' => '获取失败!']; 
        }
        return BaseFun::jsonReturn($ArrDate);
    }
    

}
